package com.sgb.jicai.view.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.sgb.jicai.BR;
import com.sgb.jicai.R;
import com.sgb.link.entity.PublicTypeEntity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

/**
 * Time:2021/9/22
 * AUTHOR:F_Q
 * Description:
 */
public class JCMachineTypeRAdapter extends BaseRecycleAdapter<PublicTypeEntity> {
    private ImageView imageView;

    public JCMachineTypeRAdapter(Context context, List<PublicTypeEntity> datas) {
        super(context, R.layout.jc_item_machine_type_r, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, final PublicTypeEntity entity) {
        holder.setBinding(BR.viewModel, entity);
        imageView = holder.itemView.findViewById(R.id.photo_img);
        Glide.with(context).load(entity.getIcon()).into(imageView);
    }
}
